package com.george.shartdingsphere.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.george.shartdingsphere.dao.ProductDao;
import com.george.shartdingsphere.entity.ProductEntity;
import com.george.shartdingsphere.entity.mapper.ProductMapper;
import org.springframework.stereotype.Repository;

@Repository
public class ProductDaoImpl extends ServiceImpl<ProductMapper, ProductEntity> implements ProductDao {


    @Override
    public ProductEntity selectByProductNumber(Long number) {
        QueryWrapper<ProductEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda()
                .eq(ProductEntity::getProductNumber, number);
        return baseMapper.selectOne(queryWrapper);
    }
}
